﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Uc_Product_NewProductByGroupProduct : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            InitViewer();
        }
    }
    private void InitViewer()
    {
        int brandid = 0;
        int groupProduct = 0;
        int parentGroupProduct = 0;
        string listProductId = "";

        if (Request.QueryString["bi"] != null)
        {
            brandid = int.Parse(Request.QueryString["bi"].ToString());
        }
        if (Request.QueryString["gpi"] != null)
        {
            groupProduct = int.Parse(Request.QueryString["gpi"].ToString());
        }
        if (Request.QueryString["pgpi"] != null)
        {
            parentGroupProduct = int.Parse(Request.QueryString["pgpi"].ToString());
        }
        divListProduct.InnerHtml = NewProductByGroupProductViewer.View(6, groupProduct, brandid, ref listProductId);

        listProductId = "var _listProductId = \"" + listProductId + "\";";
        Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "ListProductId---------", listProductId, true);
    }
}